Skip to content

read command line input for agent image path name - #1678

Closed
lavigne958 wants to merge 1 commit into
mainfrom
crayon/config_custom_agent_image_name
Closed

read command line input for agent image path name#1678
lavigne958 wants to merge 1 commit into
mainfrom
crayon/config_custom_agent_image_name

Conversation

@lavigne958

Copy link
Copy Markdown
Contributor

What does this PR do?

When the user provides an agent/clusterAgent image full path name use it in the GCP/GKE deployment.

Which scenarios this will impact?

GCP + Azure

Motivation

Allows someone to deploy a cluster with a custom image.

Additional Notes

@lavigne958
lavigne958 requested review from a team August 25, 2025 14:18
@lavigne958 lavigne958 self-assigned this Aug 25, 2025
@lavigne958
lavigne958 requested a review from a team as a code owner August 25, 2025 14:18
@lavigne958 lavigne958 added enhancement New feature or request good first issue Good for newcomers go Pull requests that update Go code labels Aug 25, 2025
When the user provides an agent/clusterAgent image full path name use it
in the GCP/GKE deployment.

Signed-off-by: Alexandre Lavigne <alexandre.lavigne@datadoghq.com>
@lavigne958
lavigne958 force-pushed the crayon/config_custom_agent_image_name branch from f52cc1e to 3082d7d Compare September 1, 2025 12:15
@lavigne958
lavigne958 removed the request for review from a team September 3, 2025 15:27

@frank-spano frank-spano left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Comment on lines +70 to +77
if agentFullImagePath := env.AgentFullImagePath(); agentFullImagePath != "" {
k8sAgentOptions = append(k8sAgentOptions, kubernetesagentparams.WithAgentFullImagePath(agentFullImagePath))
}

if clusterAgentFullImagePath := env.ClusterAgentFullImagePath(); clusterAgentFullImagePath != "" {
k8sAgentOptions = append(k8sAgentOptions, kubernetesagentparams.WithClusterAgentFullImagePath(clusterAgentFullImagePath))
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you experienced unexpected behavior before adding that?
Because what you just added is supposed to already be handled deeper in the function that install the agent on Kubernetes: https://github.com/DataDog/test-infra-definitions/blob/main/components/datadog/agent/kubernetes_helm.go#L140-L150

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see yes it does what I was looking for, but cause it's not next to the other options. I did not see it.

I will close this PR then it's not necessary then.

return components.NewComponent(&env, env.Namer.ResourceName("gke"), func(comp *kubeComp.Cluster) error {
cluster, kubeConfig, err := gke.NewCluster(env, "gke", params.autopilot)
return components.NewComponent(&env, env.Namer.ResourceName(env.Ctx().Stack()), func(comp *kubeComp.Cluster) error {
cluster, kubeConfig, err := gke.NewCluster(env, env.Namer.ResourceName(env.Ctx().Stack()), params.autopilot)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cluster, kubeConfig, err := gke.NewCluster(env, env.Namer.ResourceName(env.Ctx().Stack()), params.autopilot)
cluster, kubeConfig, err := gke.NewCluster(env, env.Namer.ResourceName("gke"), params.autopilot)

The namer should already be responsible for adding a prefix derived from the stack name

@lavigne958

Copy link
Copy Markdown
Contributor Author

duplicate use of option.

the image nanme option is already used to build the right image name.
closing this PR

@lavigne958 lavigne958 closed this Sep 10, 2025
@lavigne958
lavigne958 deleted the crayon/config_custom_agent_image_name branch October 6, 2025 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update Go code good first issue Good for newcomers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants